package com.lsh.oms.core.model.order;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * Created by wuhao on 2020/1/6.
 */
@Setter
@Getter
@NoArgsConstructor
public class CalOrderContent implements Serializable {


    private CalOrderReceiptContent receipt;

    @JSONField(name = "return")
    private CalOrderReturnContent returnContent;

    public void fixMoney(){
        if(receipt != null){
            CalOrderReceiptHead head = receipt.getHead();
            if(BigDecimal.ZERO.compareTo(head.getMoney())==0){
                head.setMoney(new BigDecimal(0.01));
            }
        }
    }

}
